<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfDiscoveryAvahi</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch02.html" title="Common libinfinity API">
<link rel="prev" href="InfSimulatedConnection.html" title="InfSimulatedConnection">
<link rel="next" href="InfXmppManager.html" title="InfXmppManager">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfSimulatedConnection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfXmppManager.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfDiscoveryAvahi.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfDiscoveryAvahi.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfDiscoveryAvahi.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfDiscoveryAvahi.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#InfDiscoveryAvahi.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="InfDiscoveryAvahi">
<a name="InfDiscoveryAvahi"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfDiscoveryAvahi.top_of_page"></a>InfDiscoveryAvahi</span></h2>
<p>InfDiscoveryAvahi — Service Discovery via Avahi</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfDiscoveryAvahi.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/common/inf-discovery-avahi.h&gt;

                    <a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi-struct" title="InfDiscoveryAvahi">InfDiscoveryAvahi</a>;
                    <a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahiClass" title="InfDiscoveryAvahiClass">InfDiscoveryAvahiClass</a>;
<a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="returnvalue">InfDiscoveryAvahi</span></a> * <a class="link" href="InfDiscoveryAvahi.html#inf-discovery-avahi-new" title="inf_discovery_avahi_new ()">inf_discovery_avahi_new</a>             (<em class="parameter"><code><a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a> *io</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppManager.html" title="InfXmppManager"><span class="type">InfXmppManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a> *creds</code></em>,
                                                         <em class="parameter"><code><span class="type">Gsasl</span> *sasl_context</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sasl_mechanisms</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfDiscoveryAvahi.html#inf-discovery-avahi-set-security-policy" title="inf_discovery_avahi_set_security_policy ()">inf_discovery_avahi_set_security_policy</a>
                                                        (<em class="parameter"><code><a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> *discovery</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a> plcy</code></em>);
<a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="returnvalue">InfXmppConnectionSecurityPolicy</span></a>  <a class="link" href="InfDiscoveryAvahi.html#inf-discovery-avahi-get-security-policy" title="inf_discovery_avahi_get_security_policy ()">inf_discovery_avahi_get_security_policy</a>
                                                        (<em class="parameter"><code><a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> *discovery</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfDiscoveryAvahi.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----InfDiscoveryAvahi
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="InfDiscoveryAvahi.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
InfDiscoveryAvahi implements
 <a class="link" href="InfDiscovery.html" title="InfDiscovery">InfDiscovery</a> and  <a class="link" href="InfLocalPublisher.html" title="InfLocalPublisher">InfLocalPublisher</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="InfDiscoveryAvahi.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi--credentials" title='The "credentials" property'>credentials</a>"              <a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a>*  : Read / Write / Construct
  "<a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi--io" title='The "io" property'>io</a>"                       <a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi--sasl-context" title='The "sasl-context" property'>sasl-context</a>"             <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct
  "<a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi--sasl-mechanisms" title='The "sasl-mechanisms" property'>sasl-mechanisms</a>"          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct
  "<a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi--security-policy" title='The "security-policy" property'>security-policy</a>"          <a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a>  : Read / Write
  "<a class="link" href="InfDiscoveryAvahi.html#InfDiscoveryAvahi--xmpp-manager" title='The "xmpp-manager" property'>xmpp-manager</a>"             <a class="link" href="InfXmppManager.html" title="InfXmppManager"><span class="type">InfXmppManager</span></a>*       : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfDiscoveryAvahi.description"></a><h2>Description</h2>
<p>
<a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> implements the <a class="link" href="InfDiscovery.html" title="InfDiscovery"><span class="type">InfDiscovery</span></a> and <a class="link" href="InfLocalPublisher.html" title="InfLocalPublisher"><span class="type">InfLocalPublisher</span></a>
interfaces on top of avahi. It resolves services to client-side
<a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>s.
</p>
<p>
This class is only available if the macro
<code class="literal">LIBINFINITY_HAVE_AVAHI</code> is defined.
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfDiscoveryAvahi.details"></a><h2>Details</h2>
<div class="refsect2" title="InfDiscoveryAvahi">
<a name="InfDiscoveryAvahi-struct"></a><h3>InfDiscoveryAvahi</h3>
<pre class="programlisting">typedef struct _InfDiscoveryAvahi InfDiscoveryAvahi;</pre>
<p>
<a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> is an opaque data type. You should only access it
via the public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="InfDiscoveryAvahiClass">
<a name="InfDiscoveryAvahiClass"></a><h3>InfDiscoveryAvahiClass</h3>
<pre class="programlisting">typedef struct {
} InfDiscoveryAvahiClass;
</pre>
<p>
This structure does not contain any public fields.
</p>
</div>
<hr>
<div class="refsect2" title="inf_discovery_avahi_new ()">
<a name="inf-discovery-avahi-new"></a><h3>inf_discovery_avahi_new ()</h3>
<pre class="programlisting"><a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="returnvalue">InfDiscoveryAvahi</span></a> * inf_discovery_avahi_new             (<em class="parameter"><code><a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a> *io</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppManager.html" title="InfXmppManager"><span class="type">InfXmppManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a> *creds</code></em>,
                                                         <em class="parameter"><code><span class="type">Gsasl</span> *sasl_context</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sasl_mechanisms</code></em>);</pre>
<p>
Created a new <a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> object which can be used to publish and
discovery Infinote services on the local network. When resolving a
<a class="link" href="InfDiscovery.html#InfDiscoveryInfo" title="InfDiscoveryInfo"><span class="type">InfDiscoveryInfo</span></a> (which means obtaining a <a class="link" href="InfXmlConnection.html" title="InfXmlConnection"><span class="type">InfXmlConnection</span></a> for the
discovered service) a new <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> needs to be created if there
is not already one for the destination host in <em class="parameter"><code>manager</code></em>. Such
connections are created with the <em class="parameter"><code>creds</code></em> and <em class="parameter"><code>sasl_context</code></em> parameters.
These may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in which case <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> uses builtin
credentials or a builtin context, respectively.
</p>
<p>
If this <a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> is not used to discover services but only to
publish any, then <em class="parameter"><code>creds</code></em>, <em class="parameter"><code>sasl_context</code></em> and <em class="parameter"><code>sasl_mechanisms</code></em> are ignored
and can safely set to be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</p>
<p>
<em class="parameter"><code>sasl_mechanisms</code></em> specifies allowed mechanisms used for authentication with
the server. It can be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, in which case all available mechanisms are
accepted.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>io</code></em> :</span></p></td>
<td>A <a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a> object used for watching sockets and timeouts.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>A <a class="link" href="InfXmppManager.html" title="InfXmppManager"><span class="type">InfXmppManager</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>creds</code></em> :</span></p></td>
<td>The certificate credentials used for GnuTLS encryption.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sasl_context</code></em> :</span></p></td>
<td>A Gsasl context used for authentication.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sasl_mechanisms</code></em> :</span></p></td>
<td>A whitespace-separated list of accepted SASL mechanisms,
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_discovery_avahi_set_security_policy ()">
<a name="inf-discovery-avahi-set-security-policy"></a><h3>inf_discovery_avahi_set_security_policy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_discovery_avahi_set_security_policy
                                                        (<em class="parameter"><code><a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> *discovery</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a> plcy</code></em>);</pre>
<p>
Sets the <a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a> for newly created
<a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>s. It does not affect already existing
connections.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>discovery</code></em> :</span></p></td>
<td>A <a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>plcy</code></em> :</span></p></td>
<td>The new security policy.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_discovery_avahi_get_security_policy ()">
<a name="inf-discovery-avahi-get-security-policy"></a><h3>inf_discovery_avahi_get_security_policy ()</h3>
<pre class="programlisting"><a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="returnvalue">InfXmppConnectionSecurityPolicy</span></a>  inf_discovery_avahi_get_security_policy
                                                        (<em class="parameter"><code><a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a> *discovery</code></em>);</pre>
<p>
Returns the current security policy used for new
<a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>s.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>discovery</code></em> :</span></p></td>
<td>A <a class="link" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi"><span class="type">InfDiscoveryAvahi</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The current security policy.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfDiscoveryAvahi.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "credentials" property'>
<a name="InfDiscoveryAvahi--credentials"></a><h3>The <code class="literal">"credentials"</code> property</h3>
<pre class="programlisting">  "credentials"              <a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a>*  : Read / Write / Construct</pre>
<p>The GnuTLS certificate credentials used for encrypting XMPP streams.</p>
</div>
<hr>
<div class="refsect2" title='The "io" property'>
<a name="InfDiscoveryAvahi--io"></a><h3>The <code class="literal">"io"</code> property</h3>
<pre class="programlisting">  "io"                       <a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a>*                : Read / Write / Construct Only</pre>
<p>The IO object used for watching sockets and timeouts.</p>
</div>
<hr>
<div class="refsect2" title='The "sasl-context" property'>
<a name="InfDiscoveryAvahi--sasl-context"></a><h3>The <code class="literal">"sasl-context"</code> property</h3>
<pre class="programlisting">  "sasl-context"             <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct</pre>
<p>The Gsasl context used for authentication.</p>
</div>
<hr>
<div class="refsect2" title='The "sasl-mechanisms" property'>
<a name="InfDiscoveryAvahi--sasl-mechanisms"></a><h3>The <code class="literal">"sasl-mechanisms"</code> property</h3>
<pre class="programlisting">  "sasl-mechanisms"          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct</pre>
<p>The accepted SASL mechanisms for authentication.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" title='The "security-policy" property'>
<a name="InfDiscoveryAvahi--security-policy"></a><h3>The <code class="literal">"security-policy"</code> property</h3>
<pre class="programlisting">  "security-policy"          <a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a>  : Read / Write</pre>
<p>How to decide whether to use TLS.</p>
<p>Default value: INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS</p>
</div>
<hr>
<div class="refsect2" title='The "xmpp-manager" property'>
<a name="InfDiscoveryAvahi--xmpp-manager"></a><h3>The <code class="literal">"xmpp-manager"</code> property</h3>
<pre class="programlisting">  "xmpp-manager"             <a class="link" href="InfXmppManager.html" title="InfXmppManager"><span class="type">InfXmppManager</span></a>*       : Read / Write / Construct Only</pre>
<p>The XMPP manager to register resolved XMPP connections.</p>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="InfDiscoveryAvahi.see-also"></a><h2>See Also</h2>
<a class="link" href="InfDiscovery.html" title="InfDiscovery"><span class="type">InfDiscovery</span></a>, <a class="link" href="InfLocalPublisher.html" title="InfLocalPublisher"><span class="type">InfLocalPublisher</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>